package com.zhou.essearch.document;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 实体
 * @author wanghaoran
 * @version 0.1
 * @date 2021/12/13 15:22
 */
@Document(indexName = "oa_fileindex")
@Data
public class ProductDocument implements Serializable {
    @Id
    private String id;
    /** 标题 */
    @Field(searchAnalyzer = "ik_smart",analyzer = "ik_max_word",type = FieldType.Text)
    private String title ;
    /** 内容 */
    @Field(searchAnalyzer = "ik_smart",analyzer = "ik_max_word",type = FieldType.Text)
    private String content ;
    /** 文件类型;后缀 */
    private String fileType ;
    /** mime协议 */
    private String mime ;
    /** 附件名称 */
    private String fileName ;
    //用户id，用于权限控制
    @Field(type = FieldType.Keyword)
    private List<String> userId;

    //业务类型
    @Field(type = FieldType.Keyword)
    private String bustype;

    /** 文件创建时间 */
    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date fileCreateTime ;

    @JSONField(format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    /** 文件Id */
    private Long fileId;

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getFileType() {
        return fileType;
    }

    public void setFileType(String fileType) {
        this.fileType = fileType;
    }

    public String getMime() {
        return mime;
    }

    public void setMime(String mime) {
        this.mime = mime;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }


    public Date getFileCreateTime() {
        return fileCreateTime;
    }

    public void setFileCreateTime(Date fileCreateTime) {
        this.fileCreateTime = fileCreateTime;
    }


    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public List<String> getUserId() {
        return userId;
    }

    public void setUserId(List<String> userId) {
        this.userId = userId;
    }

    public Long getFileId() {
        return fileId;
    }

    public void setFileId(Long fileId) {
        this.fileId = fileId;
    }

    public String getBustype() {
        return bustype;
    }

    public void setBustype(String bustype) {
        this.bustype = bustype;
    }

}
